import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import Components from 'unplugin-vue-components/vite';
import AutoImport  from "unplugin-auto-import/vite";
import { VantResolver } from 'unplugin-vue-components/resolvers';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
// https://vitejs.dev/config/
export default defineConfig({
  root:__dirname,
  plugins: [
    vue(),
    vueJsx(),
    Components({
      resolvers: [VantResolver(),ElementPlusResolver()],
      dts:"./src/dts/components.d.ts"
    }),
    AutoImport({
      resolvers: [ElementPlusResolver()],
      imports: ['vue', 'vue-router', 'vue-i18n', '@vueuse/head', '@vueuse/core'],
      dts:"./src/dts/hooks.d.ts"
    })
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  build:{
    chunkSizeWarningLimit:1500
  },
  server:{
    port:3000,
    strictPort:true,
    host:"0.0.0.0"
  }
})
